package tests;

import simulation.AgentManager;
import simulation.TrafficInfrastructureManager;
import agents.resource.CrossRoadAgent;
import agents.resource.RoadAgent;
import domain.CrossRoad;
import domain.Road;

public class ExperimentSetup2 {
	
	public ExperimentSetup2() {
		infrastructure = new TrafficInfrastructureManager();
		agents = new AgentManager();
		createTest();
	}
	
	private void createTest() {
		
		CrossRoad c1 = new CrossRoad(0, 4, "c1");
		infrastructure.addCrossRoad(c1);
		CrossRoadAgent agentC1 = new CrossRoadAgent(c1);
		agents.addResourceAgent(agentC1); 
		
		CrossRoad c2 = new CrossRoad(4, 2, "c2");
		infrastructure.addCrossRoad(c2);
		CrossRoadAgent agentC2 = new CrossRoadAgent(c2);
		agents.addResourceAgent(agentC2); 
		
		Road road12 = new Road(c2,c1,"road12");
		infrastructure.addRoad(road12);
		RoadAgent agent12 = new RoadAgent(road12, agentC2, agentC1);
		agents.addResourceAgent(agent12);
		
		CrossRoad c3 = new CrossRoad(8, 2, "c3");
		infrastructure.addCrossRoad(c3);
		CrossRoadAgent agentC3 = new CrossRoadAgent(c3);
		agents.addResourceAgent(agentC3); 
		
		Road road23 = new Road(c3,c2,"road23");
		infrastructure.addRoad(road23);
		RoadAgent agent23 = new RoadAgent(road23, agentC3, agentC2);
		agents.addResourceAgent(agent23);
		
		CrossRoad c4 = new CrossRoad(12, 1, "c4");
		infrastructure.addCrossRoad(c4);
		CrossRoadAgent agentC4 = new CrossRoadAgent(c4);
		agents.addResourceAgent(agentC4); 
		
		Road road34 = new Road(c4,c3,"road34");
		infrastructure.addRoad(road34);
		RoadAgent agent34 = new RoadAgent(road34, agentC4, agentC3);
		agents.addResourceAgent(agent34);
		
		CrossRoad c5 = new CrossRoad(12, 3, "c5");
		infrastructure.addCrossRoad(c5);
		CrossRoadAgent agentC5 = new CrossRoadAgent(c5);
		agents.addResourceAgent(agentC5); 
		
		Road road35 = new Road(c5,c3,"road35");
		infrastructure.addRoad(road35);
		RoadAgent agent35 = new RoadAgent(road35, agentC5, agentC3);
		agents.addResourceAgent(agent35);
		
		CrossRoad c6 = new CrossRoad(4, 6, "c6");
		infrastructure.addCrossRoad(c6);
		CrossRoadAgent agentC6 = new CrossRoadAgent(c6);
		agents.addResourceAgent(agentC6); 
		
		Road road16 = new Road(c6,c1,"road16");
		infrastructure.addRoad(road16);
		RoadAgent agent16 = new RoadAgent(road16, agentC6, agentC1);
		agents.addResourceAgent(agent16);
		
		Road road36 = new Road(c3,c6,"road36");
		infrastructure.addRoad(road36);
		RoadAgent agent36 = new RoadAgent(road36, agentC3, agentC6);
		agents.addResourceAgent(agent36);
	}

	public TrafficInfrastructureManager getInfrastructure(){
		return infrastructure;
	}
	
	public AgentManager getAgents(){
		return agents;
	}
	
	private TrafficInfrastructureManager infrastructure;
	private AgentManager agents;
	
}
